package cn.zjq02.zuoye.One.six;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class Lottery {
    public static void main(String[] args) {
        List<Integer> ballList = new ArrayList<>();
        getRedBall(ballList);
        getBlueBall(ballList);
    }

    public static void getRedBall(List<Integer> list) {
        Random random = new Random();
        for (int i = 0; i < 6; i++) {
            int redBall = random.nextInt(33) + 1;
            while (list.contains(redBall)) {
                redBall = random.nextInt(33) + 1;
            }
            list.add(redBall);
            Collections.sort(list);
        }

    }

    public static void getBlueBall(List<Integer> list) {
        Random random = new Random();
        int blueBall = random.nextInt(16) + 1;
        list.add(blueBall);
    }
}